/**
 * AddTakenProjectForm class.
 */
package pits.form;

import javax.portlet.ActionRequest;

import pits.util.Errand;

public class AddTakenProjectForm {

	private String employeeID;
	private String projectID;
	private String roleID;
	private String roleName;

	public AddTakenProjectForm(int empID) {
		this.employeeID = "" + empID;
	}

	public void setFields(ActionRequest request) {

		pits.util.Errand errand = new Errand();

		if (request.getParameter("projectID") != null) {
			setProjectID(request.getParameter("projectID"));
		}
		if (request.getParameter("role") != null) {
			if (!errand.isNumber(request.getParameter("role"))) {
				setRoleName(request.getParameter("role"));
			} else {
				setRoleID(request.getParameter("role"));
			}
		}
	}

	/**
	 * @return the employeeID
	 */
	public String getEmployeeID() {
		return employeeID;
	}

	/**
	 * @param employeeID
	 *            the employeeID to set
	 */
	public void setEmployeeID(String employeeID) {
		this.employeeID = employeeID;
	}

	/**
	 * @return the projectID
	 */
	public String getProjectID() {
		return projectID;
	}

	/**
	 * @param projectID
	 *            the projectID to set
	 */
	public void setProjectID(String projectID) {
		this.projectID = projectID;
	}

	/**
	 * @return the roleID
	 */
	public String getRoleID() {
		return roleID;
	}

	/**
	 * @param roleID
	 *            the roleID to set
	 */
	public void setRoleID(String roleID) {
		this.roleID = roleID;
	}

	/**
	 * @return the roleName
	 */
	public String getRoleName() {
		return roleName;
	}

	/**
	 * @param roleName
	 *            the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
}
